Skip to content

Import trading_calendar from alpha-engine-lib (single source of truth)#49

Merged
cipher813 merged 1 commit into
mainfrom
fix/universe-returns-import-from-lib
Apr 16, 2026
Merged

Import trading_calendar from alpha-engine-lib (single source of truth)#49
cipher813 merged 1 commit into
mainfrom
fix/universe-returns-import-from-lib

Conversation

@cipher813
Copy link
Copy Markdown
Owner

Summary

Phase 1 of the architecturally-correct fix for the trading_calendar issue. Closes the regression #43 introduced and supersedes the patchwork #48 (now closed).

`collectors/universe_returns.py` imports `trading_calendar` at the top-level, which broke when #43 moved that file out of the repo. Rather than restore a duplicate local copy (the approach in now-closed #48), this PR imports from `alpha_engine_lib.trading_calendar` — single source of truth across all Alpha Engine modules.

Changes

```diff

  • from trading_calendar import is_trading_day as nyse_is_trading_day
  • from alpha_engine_lib.trading_calendar import is_trading_day as nyse_is_trading_day
    ```

```diff

Sequencing

  • cipher813/alpha-engine-lib#4 merged + tagged v0.1.3
  • Merge this PR
  • Re-run spot smoke: `ae-dashboard "cd /home/ec2-user/alpha-engine-data && export HOME=/home/ec2-user && bash infrastructure/spot_data_weekly.sh --smoke-only"` — spot pip-installs `@v0.1.3`, `universe_returns.collect()` finds `alpha_engine_lib.trading_calendar` at import time

Phase 2 (separate session, roadmap)

Remove the duplicate `trading_calendar.py` from alpha-engine-dashboard and update the Step Function `CheckTradingDay` SSM command to `python -m alpha_engine_lib.trading_calendar`. Requires first adding `AE_LIB_TOKEN` SSM fetch + git `insteadOf` setup to alpha-engine-dashboard's `boot-pull.sh` and pinning the lib in its requirements.txt. Keeping the dashboard copy in place tonight so Saturday's CheckTradingDay step keeps working.

🤖 Generated with Claude Code

Closes the loop on the de-bloat split regression. collectors/universe_returns.py
was importing `from trading_calendar import is_trading_day`, which broke
when #43 moved the file out of this repo. Rather than restore a local copy
(the patchwork approach in the now-closed #48), import from
alpha_engine_lib.trading_calendar — a single source of truth shared across
all Alpha Engine modules.

- collectors/universe_returns.py: `from alpha_engine_lib.trading_calendar ...`
- requirements.txt: bump alpha-engine-lib pin @v0.1.1 → @v0.1.3

Requires cipher813/alpha-engine-lib#4 merged + tagged v0.1.3 first.
Spots pip-install from the git tag, so the new module appears at
install time without any other plumbing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cipher813 cipher813 force-pushed the fix/universe-returns-import-from-lib branch from 557574a to 7e145f6 Compare April 16, 2026 19:01
@cipher813 cipher813 merged commit b06f79b into main Apr 16, 2026
1 check passed
@cipher813 cipher813 deleted the fix/universe-returns-import-from-lib branch April 16, 2026 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant